All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.qd3d.math.Quaternion
java.lang.Object
|
+----quicktime.util.QTByteObject
|
+----quicktime.qd3d.math.Quaternion
- public final class Quaternion
- extends QTByteObject
- implements QuickTimeLib, QuickDraw3DLib, Cloneable
Quaternion A quadruple of floating-point numbers that obeys the laws of quaternion arithmetic.
A Quaternion transform will rotate and twist an object according to the mathematical properties of quaternions.
Refer to TQ3Quaternion in QuickDraw3d
-
kNativeSize
- This is the size (the number of bytes) that are required for this class
-
Quaternion()
- Creates a Quaternion object set to the identity.
-
Quaternion(float, float, float, float)
- Creates a Quaternion object containing given data.
-
clone()
- Returns a copy of this class.
-
copy()
- Returns a copy of the quaternion.
-
dot(Quaternion)
- Returns the dot product of two quaternions, this and q2.
-
getEndianDescriptor()
- Returns the EndianDescriptor for this class.
-
getW()
- returns the w value
-
getX()
- returns the position in the x direction
-
getY()
- returns the position in the y direction
-
getZ()
- returns the position in the z direction
-
interpolateFast(Quaternion, float)
- Return a a quaternion that is a fast interpolation between the this and the
specified quaternion.
-
interpolateLinear(Quaternion, float)
- Return a a quaternion that is a linear interpolation between the this and the
specified quaternion.
-
invert()
- Returns the inverse of the quaternion.
-
isIdentity()
- Returns rue if the quaternion is an identity quaternion.
-
matchReflection(Quaternion)
- Returns a quaternion that is either identical to the quaternion
specified by the q1 parameter or is the negative of q1, depending on whether q1
or its negative matches the orientation of the quaternion specified by the q2
parameter.
-
multiply(Quaternion)
- Returns the product of the two quaternions, this and q2.
-
normalize()
- Returns a normalized the quaternion.
-
setIdentity()
- Sets the Quaternion to the identity quaternion.
-
setMatrix(Matrix4x4)
- Sets a quaternion that has the same transformational properties as the matrix
specified by the matrix parameter.
-
setRotateAboutAxis(Vector3D, float)
- Sets a a rotate-about-axis quaternion that rotates an
object by the angle angle around the axis specified by the axis parameter.
-
setRotateVectorToVector(Vector3D, Vector3D)
- Sets a rotational quaternion that rotates objects
around the origin in such a way that the transformed vector v1 matches the
vector v2.
-
setRotateX(float)
- Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
-
setRotateXYZ(float, float, float)
- Sets a rotational quaternion that rotates an object by the specified angles around their
specified axis.
-
setRotateY(float)
- Sets a rotational quaternion that rotates an object by the specified angle around the y axis.
-
setRotateZ(float)
- Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
-
setW(float)
- sets the w value
-
setX(float)
- sets the position in the x direction
-
setY(float)
- sets the position in the y direction
-
setZ(float)
- sets the position in the z direction
kNativeSize
public static final int kNativeSize
- This is the size (the number of bytes) that are required for this class
Quaternion
public Quaternion()
- Creates a Quaternion object set to the identity.
QuickDraw3D::Q3Quaternion_SetIdentity
Quaternion
public Quaternion(float w,
float x,
float y,
float z)
- Creates a Quaternion object containing given data.
- Parameters:
- w - The final w value.
- x - The final x position.
- y - The final y position.
- z - The final z position.
getEndianDescriptor
public static final EndianDescriptor getEndianDescriptor()
- Returns the EndianDescriptor for this class.
- Returns:
- an EndianDescriptor
getW
public float getW()
- returns the w value
getX
public float getX()
- returns the position in the x direction
getY
public float getY()
- returns the position in the y direction
getZ
public float getZ()
- returns the position in the z direction
setW
public void setW(float w)
- sets the w value
setX
public void setX(float x)
- sets the position in the x direction
setY
public void setY(float y)
- sets the position in the y direction
setZ
public void setZ(float z)
- sets the position in the z direction
copy
public Quaternion copy()
- Returns a copy of the quaternion.
QuickDraw3D::Q3Quaternion_Copy
- Returns:
- a copy of quaternion.
setIdentity
public void setIdentity()
- Sets the Quaternion to the identity quaternion.
QuickDraw3D::Q3Quaternion_SetIdentity
isIdentity
public boolean isIdentity()
- Returns rue if the quaternion is an identity quaternion.
QuickDraw3D::Q3Quaternion_IsIdentity
- Returns:
- true if the quaternion is an identity quaternion
invert
public Quaternion invert()
- Returns the inverse of the quaternion.
QuickDraw3D::Q3Quaternion_Invert
- Returns:
- the invert quaternion
multiply
public Quaternion multiply(Quaternion q2)
- Returns the product of the two quaternions, this and q2.
QuickDraw3D::Q3Quaternion_Multiply
- Parameters:
- q2 - a quaternion
- Returns:
- the product
normalize
public Quaternion normalize()
- Returns a normalized the quaternion.
QuickDraw3D::Q3Quaternion_Normalize
- Returns:
- the normalized quaternion
dot
public float dot(Quaternion q2)
- Returns the dot product of two quaternions, this and q2.
QuickDraw3D::Q3Quaternion_Dot
- Parameters:
- q2 - A quaternion.
- Returns:
- the dot product
setRotateAboutAxis
public void setRotateAboutAxis(Vector3D axis,
float angle)
- Sets a a rotate-about-axis quaternion that rotates an
object by the angle angle around the axis specified by the axis parameter.
QuickDraw3D::Q3Quaternion_SetRotateAboutAxis
- Parameters:
- axis - The desired axis of rotation.
- angle - The desired angle of rotation, in radians.
setRotateX
public void setRotateX(float angle)
- Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
QuickDraw3D::Q3Quaternion_SetRotate_X
- Parameters:
- angle - The desired angle of rotation around the x coordinate axis, in radians.
setRotateY
public void setRotateY(float angle)
- Sets a rotational quaternion that rotates an object by the specified angle around the y axis.
QuickDraw3D::Q3Quaternion_SetRotate_Y
- Parameters:
- angle - The desired angle of rotation around the y coordinate axis, in radians.
setRotateZ
public void setRotateZ(float angle)
- Sets a rotational quaternion that rotates an object by the specified angle around the x axis.
QuickDraw3D::Q3Quaternion_SetRotate_Z
- Parameters:
- angle - The desired angle of rotation around the z coordinate axis, in radians.
setRotateXYZ
public void setRotateXYZ(float xAngle,
float yAngle,
float zAngle)
- Sets a rotational quaternion that rotates an object by the specified angles around their
specified axis.
QuickDraw3D::Q3Quaternion_SetRotate_XYZ
- Parameters:
- xAngle - The desired angle of rotation around the x coordinate axis, in radians.
- yAngle - The desired angle of rotation around the y coordinate axis, in radians.
- zAngle - The desired angle of rotation around the z coordinate axis, in radians.
setMatrix
public void setMatrix(Matrix4x4 matrix)
- Sets a quaternion that has the same transformational properties as the matrix
specified by the matrix parameter.
QuickDraw3D::Q3Quaternion_SetMatrix
- Parameters:
- matrix - A 4-by-by matrix.
setRotateVectorToVector
public void setRotateVectorToVector(Vector3D v1,
Vector3D v2)
- Sets a rotational quaternion that rotates objects
around the origin in such a way that the transformed vector v1 matches the
vector v2. Both v1 and v2 should be normalized.
QuickDraw3D::Q3Quaternion_SetRotateVectorToVector
- Parameters:
- v1 - A three-dimensional vector.
- v2 - A three-dimensional vector.
matchReflection
public Quaternion matchReflection(Quaternion q2)
- Returns a quaternion that is either identical to the quaternion
specified by the q1 parameter or is the negative of q1, depending on whether q1
or its negative matches the orientation of the quaternion specified by the q2
parameter.
QuickDraw3D::Q3Quaternion_MatchReflection
- Parameters:
- q2 - A quaternion.
- Returns:
- a quaternion that is either q1 or the negative of q1, and that matches the orientation of q2.
interpolateFast
public Quaternion interpolateFast(Quaternion q2,
float t)
- Return a a quaternion that is a fast interpolation between the this and the
specified quaternion.
QuickDraw3D::Q3Quaternion_InterpolateFast
- Parameters:
- q2 - A quaternion.
- t - An interpolation factor. This parameter should contain a value between 0.0 and 1.0.
- Returns:
- a quaternion
interpolateLinear
public Quaternion interpolateLinear(Quaternion q2,
float t)
- Return a a quaternion that is a linear interpolation between the this and the
specified quaternion.
QuickDraw3D::Q3Quaternion_InterpolateLinear
- Parameters:
- q2 - A quaternion.
- t - An interpolation factor. This parameter should contain a value between 0.0 and 1.0.
- Returns:
- a quaternion
clone
public Object clone()
- Returns a copy of this class.
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index